//
//  HJVocie.h
//  textView
//
//  Created by hu on 2019/4/3.
//  Copyright © 2019 hu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface HJVocie : NSObject

/**
 倒计时数
 */
@property (nonatomic,assign) NSInteger countDown;
/**
 初始化录音和播放
 @param countDown 定时器秒数
 @return self
 */
-(instancetype)initVocieWithCountDown:(NSInteger)countDown;

/**
 @return 判断是否打卡了麦克风
 */
- (BOOL)canRecord;
/**
 播放录音 wav
 */
-(void)playRecordButtonTouchUpInsideWithVocieData:(NSData *)vocieData;
/**
 按住说话
 */
-(void)recordButtonTouchDown;

/**
 松开发送
 @param block 错误信息、语音文件路径
 */
-(void)sendRecord;
//-(void)recordButtonTouchUpInsideWithBlock:(void(^)(NSString *error,NSData * vocieData, BOOL isSend, long duration))block;

@property (nonatomic,copy) void (^sendRecordBlock)(NSString *error,NSData * vocieData, BOOL isSend, long duration);
/**
 上滑离开按钮区域松开 取消
 */
- (void)recordButtonTouchUpOutside;

/**
松开手指，取消发送
 */
- (void)recordButtonTouchUpDragExit;

/**
 手指上滑，取消发送
 */
- (void)recordButtonTouchUpDragEnter;
@end

NS_ASSUME_NONNULL_END
